home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / smtk.exe / SMTK.DOC
Text File  |  1993-01-21  |  70KB  |  1,914 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                    @@
  11.                  @@@@
  12.               @@@
  13.             @@                                    @   @@
  14.          @@@                                      @  @@@
  15.       @@@@                                        @ @@
  16.     @@@@            @@    @@   @@@   @@@@@  @@@@@ @@@    @@@@@ @  @@  @@@@@
  17.     @@              @@@  @@@  @@@@@  @@@@@  @@@@@ @@    @      @  @@ @
  18.     @@@@@@@@@@@@@@  @ @@@@ @ @@   @@ @    @   @   @@@   @@@@@  @  @@ @@@@@@
  19.      @@@@@@@@@@@@@@ @  @@  @ @     @ @ @@@@   @   @ @@  @      @  @@ @@@@@@
  20.                  @@ @@    @@ @ @@@ @ @  @@    @   @  @@ @@@@@@ @  @@      @
  21.                @@@@ @@    @@ @ @@@ @ @   @@   @   @   @@ @@@@@  @@@  @@@@@
  22.              @@@@                                                 @
  23.            @@@      An Advanced-Customization Tool           @@@@@@
  24.          @@                                                   @@@@
  25.       @@@           COPYRIGHT (C) 1992-93
  26.   @@@@
  27.   @@                Simone A. Rapisarda        Version 1.59  (16 Gen 1993)
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.                  #   #   ####  #####  ####     #     ####
  39.                  #   #  #      #      #   #   #     #
  40.                  #   #   ###   ####   ####           ###
  41.                  #   #      #  #      #   #             #
  42.                   ###   ####   #####  #   #         ####
  43.  
  44.  
  45.                  #   #   ###   #   #  #   #   ###   #
  46.                  ## ##  #   #  ##  #  #   #  #   #  #
  47.                  # # #  #####  # # #  #   #  #####  #
  48.                  #   #  #   #  #  ##  #   #  #   #  #
  49.                  #   #  #   #  #   #   ###   #   #  #####
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.                                 CONTENTS
  69.  
  70.  
  71.  1.  Introduction........................................................   1
  72.      1.1   Description of the Library....................................   1
  73.      1.2   Releasing Notes...............................................   2
  74.      1.3   Acknowledgements..............................................   3
  75.  
  76.  2.  SmartKeys Commands..................................................   4
  77.      2.1   Important Notes...............................................   4
  78.      2.2   Commands in the SmartKeys Menu................................   7
  79.      2.3   Description of each Command (in order of appearance)..........   8
  80.            ASNK..........................................................   8
  81.            RCLK..........................................................   8
  82.            DELK..........................................................   9
  83.            DISPK.........................................................   9
  84.            STDK..........................................................   9
  85.            RECK..........................................................  10
  86.            KEYN..........................................................  10
  87.            \->IFCMDTE....................................................  11
  88.            \->IFIMMTE....................................................  11
  89.            \->IFPRGTE....................................................  11
  90.            \->IFALGTE....................................................  11
  91.            \->IF1KTE.....................................................  12
  92.            \->EVL........................................................  12
  93.            \->PSH........................................................  12
  94.            \->EDIT.......................................................  12
  95.            \->EQW........................................................  12
  96.            ADDFR.........................................................  13
  97.            'BADK.........................................................  13
  98.            \->KB.........................................................  13
  99.            KB\->.........................................................  14
  100.            \->KBN........................................................  14
  101.            KBN\->........................................................  14
  102.            KBNM..........................................................  14
  103.            KBMN..........................................................  14
  104.            GETKEYS.......................................................  15
  105.            PUTKEYS.......................................................  15
  106.            PACKKEYS......................................................  15
  107.            DOKEY.........................................................  16
  108.            SAFE..........................................................  16
  109.            DUAL..........................................................  16
  110.            \->CSTM.......................................................  16
  111.            \->MENU.......................................................  17
  112.            HTRIM.........................................................  17
  113.            ABOUTSK.......................................................  17
  114.            $CONFIG.......................................................  18
  115.  
  116.  3.  Command Usage Examples..............................................  19
  117.      3.1   Commands used: \->IFPRGTE ASNK................................  19
  118.      3.2   Commands used: STDK \->IFCMDTE ASNK...........................  19
  119.      3.3   Commands used: KEYN RECK ASNK.................................  20
  120.      3.4   Commands used: \->PSH \->EVL \->IFPRGTE \->EDIT \->IFCMDTE....  20
  121.      3.5   Command used: DOKEY...........................................  21
  122.      3.6   Command used: SAFE............................................  21
  123.      3.7   Command used: DUAL............................................  22
  124.      3.8   Command used: \->IF1KTE.......................................  22
  125.      3.9   Command used: \->MENU.........................................  22
  126.  
  127.      Appendixes..........................................................  23
  128.      A     Unused and Useless HP48 Default Key Assignments...............  23
  129.      B     The Internal UserKeys List....................................  24
  130.      C     Quick Reference Guide.........................................  25
  131.  
  132.  
  133.  
  134.  
  135. 1.  Introduction
  136. ----------------
  137.  
  138.  
  139. 1.1   Description of the Library
  140.  
  141.       SmartKeys was born as a Library of utilities designed to increase the
  142.       power of the already powerful HP48 User Keyboard capability. Even if
  143.       this still remains its main goal, some new commands do not have any
  144.       relation with the User Keyboard but, more generally, with the
  145.       customization of the calculator, making of SmartKeys an advanced
  146.       customization tool for the HP48.
  147.       SmartKeys is a self-attaching Library entirely written in sys-RPL.
  148.       It's 5675 bytes long and it's identified by the Library ID 1616. The
  149.       commands it contains were mainly conceived for these purposes:
  150.  
  151.       - Facilitate the usage of key assignments.
  152.         Commands: ASNK RCLK DELK DISPK KEYN PACKKEYS
  153.  
  154.       - Increase the speed of User Keyboard operations.
  155.         Commands: ASNK RCLK DELK DISPK KEYN PACKKEYS GETKEYS PUTKEYS ADDFR
  156.  
  157.       - Save key assignment memory.
  158.         Commands: ASNK DELK STDK PACKKEYS
  159.  
  160.       - Allow special key assignments normally not supported.
  161.         Commands: STDK RECK \->EVL \->PSH \->EDIT \->EQW \->IFCMDTE
  162.                   \->IFIMMTE \->IFPRGTE \->IFALGTE \->IF1KTE 'BADK
  163.  
  164.       - Increase the number of possible assignments on a single key.
  165.         Commands: \->IFCMDTE \->IFIMMTE \->IFPRGTE \->IFALGTE \->IF1KTE
  166.  
  167.       - Fill the gaps in the HP48 default key assignments.
  168.         Commands: STDK RECK \->IFCMDTE \->IFIMMTE \->IFPRGTE \->IFALGTE
  169.  
  170.       - Allow the usage of more than one User Keyboard.
  171.         Commands: \->KB KB\-> \->KBN KBN\-> KBNM KBMN GETKEYS PUTKEYS
  172.  
  173.       - Help the User Keyboard always stay active.
  174.         Command: $CONFIG (hidden)
  175.  
  176.       - Handy use of tree-structured menus.
  177.         Commands: \->CSTM \->MENU
  178.  
  179.       - Reconfigure the calculator after a warm-start.
  180.         Command: $CONFIG (hidden)
  181.  
  182.       - Provide a way to transform dangerous programs into Safe programs.
  183.         Command: SAFE
  184.  
  185.       - Allow multiple ways of execution for any program.
  186.         Command: DUAL
  187.  
  188.       - Allow key-like execution in user programs.
  189.         Command: DOKEY
  190.  
  191.       - Help the user to have a clean and tidy HOME directory.
  192.         Command: HTRIM
  193.  
  194.  
  195.  
  196.                                   Page 1
  197.  
  198.  
  199.  
  200.  
  201. 1.2   Releasing Notes
  202.  
  203.       English is not my native language and it was not one of my favourite
  204.       subjects at school. I have done my very best to write this manual in
  205.       an understandable form but I might not succeed, so I hope you will
  206.       excuse the simple words I use and any possible mistake or impropriety.
  207.  
  208.       SmartKeys has been validated on an HP48 revision E. It should work fine
  209.       for HP 48 revisions A through E. It may not work correctly for later
  210.       HP 48 revisions. In march 1993 the developing platform of SmartKeys
  211.       will change from an HP48 revision E to an HP48 revision J, till then
  212.       I won't be able to say how it works with the new ROM revision so be
  213.       careful.
  214.  
  215.       All the commands and programs contained in SmartKeys came from *my own*
  216.       ideas and experimentations. Every algorithm I used was conceived and
  217.       developed by me except those reprised from the HP48 built-in ROM.
  218.       The only exception to this are the Library_Data-handling programs used
  219.       in KB\-> and \->KB that were conceived and written by Detlef Mueller
  220.       and Raymond Hellstern.
  221.  
  222.       SmartKeys is distributed in the hope that it will be useful; even if
  223.       its commands have been tested (on a HP48 revision E) they make use of
  224.       undocumented features, so use them at your own risk: I take no
  225.       responsibility for any damage caused by their use or misuse.
  226.       The SmartKeys Library and this manual are Copyright (C) 1992-93 by
  227.       Simone A. Rapisarda. Non-commercial distribution is allowed and
  228.       encouraged if this manual, unchanged, accompanies the unmodified
  229.       Library.
  230.  
  231.       You can extract and use parts of SmartKeys in other libraries or
  232.       programs only if these are Public Domain or Freeware. Anyway this
  233.       should be done only with my consent and their use and origin must be
  234.       reported in the documentation of the software.
  235.  
  236.       SmartKeys is GiftWare. This means that if after a period of evaluation
  237.       you find it useful and you think I deserve a contribution for all the
  238.       time I spent working on it (not a little, believe me!), feel free to
  239.       send me a gift: cookies, chocolate, cakes, Alka-Seltzers, a 512K RAM
  240.       card  etc. ;-). But if you can't afford a gift don't worry, a postcard
  241.       to the following address will be also welcome:
  242.  
  243.       Simone A. Rapisarda
  244.       via Livia Gereschi, 6
  245.       56127  PISA
  246.              ITALY
  247.  
  248.       If you have comments, suggestions, questions, or criticisms, I would
  249.       really like to receive them at the above address. I will reply to
  250.       every letter. If you have Email access you can also reach me using
  251.       the following address:
  252.  
  253.       Simone_Rapisarda@p10.f800.n33.z2.fidonet.org
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                                   Page 2
  263.  
  264.  
  265.  
  266.  
  267. 1.3   Acknowledgements
  268.  
  269.       - To Joe Horn and Detlef Mueller for their precious suggestions.
  270.  
  271.       - To Joe Horn again, for is help in writing the manual.
  272.  
  273.       - To Flavia Majlis, Pablo Majlis, Roberto Taddei and Paolo Gozzini, for
  274.         their help in correcting my bad english.
  275.  
  276.       - To Flavia Majlis again, that created the nice SmartKeys screen
  277.         displayed by the command ABOUTSK.
  278.  
  279.       - To Rick Grevelle, for his great HACKIT Library that helped me a lot
  280.         in developing the earlier versions of SmartKeys and discovering many
  281.         of the HP48 undocumented features used in it.
  282.  
  283.       - To Detlef Mueller and Raymond Hellstern, for the ML programs to
  284.         handle Library Data objects and for their RPL48, a wonderful Sys-RPL
  285.         development toolkit for the HP48SX that have saved me a lot of work
  286.         and time.
  287.  
  288.       - Most of the entry points used to compile SmartKeys are documented in
  289.         a List supplied by Jake Schwartz. I thank him and all the
  290.         contributors to that List.
  291.  
  292.       - To Johann Sebastian Bach and Antonio Vivaldi for the spiritual
  293.         inspiration and confort their music gave me during night-time endless
  294.         hacking.
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                                   Page 3
  329.  
  330.  
  331.  
  332.  
  333. 2.  SmartKeys Commands
  334. ----------------------
  335.  
  336.  
  337. 2.1   Important Notes
  338.  
  339.       Please read at least all this chapter before using the Library.
  340.  
  341.  
  342.       A   If you aren't familiar with the arguments and/or terms used in this
  343.           manual I suggest you first read the 15th chapter of the HP48 User's
  344.           Manual: "Customizing the Calculator".
  345.  
  346.  
  347.       B   All the SmartKeys commands do complete argument checking and are
  348.           completely "idiot proof" so it's very unlikely that using them
  349.           would cause a disaster.
  350.  
  351.  
  352.       C   If you use the Multi Keyboard Capability (commands \->KB, KB\->,
  353.           \->KBN, KBN\->, KBNM, KBMN or USRM, STUSR, RCUSR, DOUSR, DLUSR in
  354.           older versions) then, every time you update to a new version of
  355.           SmartKeys (as soon as the new version is attached), you  MUST
  356.           execute immediately the following program so as to avoid disastrous
  357.           effects:
  358.  
  359.           %%HP: T(3);
  360.           \<< KBNM \->KB \>>
  361.  
  362.  
  363.       D   If you use the Advanced Menu System (command \->CSTM or CRCSTM in
  364.           older versions) then, every time you update to a new version of
  365.           SmartKeys (as soon as the new version is attached), you MUST
  366.           execute immediately the following program so as to avoid disastrous
  367.           effects:
  368.  
  369.           %%HP: T(3);
  370.           \<< HOME CSTM \->CSTM \>>
  371.  
  372.  
  373.       E   The built-in commands ASN, STOKEYS, RCLKEYS and DELKEYS are not
  374.           well written. The SmartKeys commands ASNK, DELK and PACKKEYS have
  375.           been written using some contrivances in order to save a theoretical
  376.           maximum of 1470 bytes in each internal UserKeys List. If you want
  377.           to take advantage of this it's best not to use the built-in
  378.           commands ASN, STOKEYS and DELKEYS at all, and use SmartKeys
  379.           commands exclusively.
  380.  
  381.  
  382.       F   The commands ASNK(1), RCLK(1), DELK(1) and STDK(1) support all six
  383.           possible assignments for all keys, except some combinations of the
  384.           two shift keys, obviously.
  385.  
  386.  
  387.       G   The commands ASNK, RCLK, DELK, DISPK, GETKEYS, PUTKEYS and PACKKEYS
  388.           work only on the current UserKeys List.
  389.  
  390.  
  391.  
  392.  
  393.  
  394.                                   Page 4
  395.  
  396.  
  397.  
  398.  
  399.       H   rc.p represents a Real that identifies a key location: r stands for
  400.           row, c stands for column and p stands for plane.
  401.  
  402.  
  403.       I   The normal HP48 keyboard has several keys that behave strangely.
  404.           For example, the CLVAR key (blue-DEL key), has a built-in safety
  405.           feature: it doesn't execute immediately, but instead puts itself
  406.           onto the command line, so that you must then press ENTER if you
  407.           really want it to execute. This allows you to press ATTN to clear
  408.           the command line if you pressed CLVAR by mistake. This is therefore
  409.           called a Safe key. SmartKeys allows you to create your own Safe key
  410.           assignments and programs. Its own ->KB command is a Safe command.
  411.  
  412.  
  413.       J   SmartKeys even allows you to create Dual keys and programs, which
  414.           are like Safe keys except that the action performed from the
  415.           keyboard is up to you. Many of the SmartKeys commands are Dual
  416.           functions; for example, ABOUTSK displays an "about" screen when
  417.           pressed from the keyboard; but, when executed from a program (or
  418.           command line), it places the SmartKeys version String on the stack.
  419.  
  420.  
  421.       K   \->CSTM and \->MENU considerably enhance the HP48 Menu System
  422.           allowing the creation of tree-structured menus that support new and
  423.           powerful types of Menu Entries and Menu Labels in a really simple
  424.           and handy way.
  425.  
  426.           With the advent of the sys-RPL era many utility have been written
  427.           to solve the tree-structured menus built-in limitation. All these
  428.           programs worked out only a part of the problem, a big part of it
  429.           was that the tree-structured menus (expecially the big ones)
  430.           created by them cannot be (at least, easely) edited and modified;
  431.           These are the reasons:
  432.  
  433.           - Not editable instructions (the misterious 'External') are
  434.             involved.
  435.  
  436.           - The built-in editor is very slow, expecially for big objects.
  437.  
  438.           - It's not easy to keep track of every '{' and '}' so to know
  439.             exactly where you are.
  440.  
  441.           \->CSTM and \->MENU solves completely all the aspects of the
  442.           problem.
  443.  
  444.           The Advanced Menu System supported by \->CSTM and \->MENU accepts
  445.           Menu Lists with the same format of those accepted by the Built-in
  446.           Menu System. The new types of menu entries are described in the
  447.           following table:
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.                                   Page 5
  461.  
  462.  
  463.  
  464.  
  465.           +=================================================================+
  466.           |                                                                 |
  467.           | If the Menu Entry is a Global Name then the Menu-Label          |
  468.           | identifier and the action performed by the not-shifted key      |
  469.           | depend on the content of the Global variable:                   |
  470.           |                                                                 |
  471.           +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+
  472.           |                                                                 |
  473.           | CONTENT            LBL-ID  ACTION                               |
  474.           |                                                                 |
  475.           | Directory          _       Enter the Directory                  |
  476.           |                            (as usual)                           |
  477.           |                                                                 |
  478.           | TakeOver Program           Always evaluate the Global Name      |
  479.           |                            ('Always' here means that if, for    |
  480.           |                            example, the command line is active, |
  481.           |                            the Global Name is not inserted in   |
  482.           |                            the command line as usual but just   |
  483.           |                            evaluated.                           |
  484.           |                            To obtain a TakeOver Program use     |
  485.           |                            the command \->EVL)                  |
  486.           |                                                                 |
  487.           | List               _       Always display the List as an        |
  488.           |                            Advanced Menu                        |
  489.           |                            (The nesting of Advanced Menus has   |
  490.           |                            no limits; So your tree-structured   |
  491.           |                            menus may grow for kilobytes and     |
  492.           |                            kilobytes without loosing in         |
  493.           |                            readability and editability: When    |
  494.           |                            you want to edit a sub-sub-...-menu  |
  495.           |                            you only need to edit the content of |
  496.           |                            the corresponding Global variable.   |
  497.           |                            I suggest you to store all the       |
  498.           |                            Global variables that contain an     |
  499.           |                            Advanced Menu List in the HOME       |
  500.           |                            directory so as they can be used     |
  501.           |                            from every directory; Remember that  |
  502.           |                            if you want you can hide them with   |
  503.           |                            the command HTRIM)                   |
  504.           |                                                                 |
  505.           +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+
  506.           |                                                                 |
  507.           | If the Menu Entry is a Global Name and the Immediate Entry Mode |
  508.           | is not active then the right-shifted key inserts the Global     |
  509.           | name in the command line.                                       |
  510.           |                                                                 |
  511.           +=================================================================+
  512.           |                                                                 |
  513.           | If the Menu Entry is an XLIB (a Library command) then the       |
  514.           | action performed by the not-shifted key depends on the content  |
  515.           | of the XLIB: if it is a TakeOver Program then (as for a Global  |
  516.           | name Menu Entry) the XLIB is always evaluated, where 'always'   |
  517.           | means that if, for example, the command line is active, the     |
  518.           | XLIB name is not inserted in the command line as usual but just |
  519.           | evaluated. In case that the Immediate Entry Mode is not active  |
  520.           | you need to press the right-shifted key in order to insert the  |
  521.           | XLIB name in the command line.                                  |
  522.           | To obtain a TakeOver Program use the command \->EVL.            |
  523.           |                                                                 |
  524.           +=================================================================+
  525.  
  526.                                   Page 6
  527.  
  528.  
  529.  
  530.  
  531.           +=================================================================+
  532.           |                                                                 |
  533.           | If the Menu Entry is a String beginning with the '&' character  |
  534.           | then the Menu-Label identifier and the actions performed by the |
  535.           | key depend on the rest of the string:                           |
  536.           |                                                                 |
  537.           +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+
  538.           |                                                                 |
  539.           | Menu Entry:         String: "&..." where ... is a Real number   |
  540.           |                                                                 |
  541.           | Label Identifier:   _                                           |
  542.           |                                                                 |
  543.           | Label Content:      Library_Title                               |
  544.           |                                                                 |
  545.           | UnShifted Action:   Display the menu of the Library             |
  546.           |                                                                 |
  547.           | R-Shifted Action:   Always Recall the Library to the stack      |
  548.           |                     ('Always' here means that the Library is    |
  549.           |                     recalled also if it's contained in a ROM    |
  550.           |                     Card or in a write-protected RAM Card)      |
  551.           |                                                                 |
  552.           +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+
  553.           |                                                                 |
  554.           | Menu Entry:         String: "&..." where '...' is a Global Name |
  555.           |                                                                 |
  556.           | Label Identifier:   _____                                       |
  557.           |                                                                 |
  558.           | Label Content:      Content of the Global variable              |
  559.           |                                                                 |
  560.           | UnShifted Action:   Evaluate the content of the Global variable |
  561.           |                                                                 |
  562.           | L-Shifted Action:   Store an object into the Global variable    |
  563.           |                                                                 |
  564.           | R-Shifted Action:   Recall the content of the Global variable   |
  565.           |                     or insert the Global name in the command    |
  566.           |                     line if not in Immediate Entry Mode         |
  567.           |                                                                 |
  568.           +=================================================================+
  569.  
  570.           The only limitation of the Advanced Menu System is that, unlike the
  571.           Built-in Menu System, it's not functional in the Equation Writer.
  572.  
  573.  
  574.       L   The SmartKeys commands DISPK and KBMN are TakeOver XLIBs so if
  575.           they are used in an Advanced Menu they are always evaluated.
  576.  
  577.  
  578.  
  579. 2.2   Commands in the SmartKeys menu
  580.  
  581.       +---------------------------------------------------------------------+
  582.       | Page 1      Page 2      Page 3     Page 4     Page 5       Page 6   |
  583.       +---------------------------------------------------------------------+
  584.       | 0 ASNK    6 KEYN       12 ->EVL   18 ->KB   24 GETKEYS   30 ->CSTM  |
  585.       | 1 RCLK    7 ->IFCMDTE  13 ->PSH   19 KB->   25 PUTKEYS   31 ->MENU  |
  586.       | 2 DELK    8 ->IFIMMTE  14 ->EDIT  20 ->KBN  26 PACKKEYS  32 HTRIM   |
  587.       | 3 DISPK   9 ->IFPRGTE  15 ->EQW   21 KBN->  27 DOKEY     33 ABOUTSK |
  588.       | 4 STDK   10 ->IFALGTE  16 ADDFR   22 KBNM   28 SAFE                 |
  589.       | 5 RECK   11 ->IF1KTE   17 'BADK   23 KBMN   29 DUAL                 |
  590.       +---------------------------------------------------------------------+
  591.  
  592.                                   Page 7
  593.  
  594.  
  595.  
  596.  
  597. 2.3   Description of each command (in order of appearance)
  598.  
  599.       +------+
  600.       | ASNK |            (ASsigN Keys)
  601.       +------+            (see examples in paragraphs 3.1, 3.2 and 3.3)
  602.  
  603.       This is a Dual command:
  604.  
  605.       (1) When executed from the keyboard:
  606.  
  607.          Needs one argument: (1:Any).
  608.  
  609.          Waits for a key to be pressed and assigns the object in level one to
  610.          that key. If an object is already assigned to that key, the command
  611.          LASTARG, if active, will push to level one the old assignment. To
  612.          abort the command execution you can press any key two times quickly.
  613.  
  614.       (2) When executed by a running program (or from the command line):
  615.  
  616.          Needs two arguments: (2:Any, 1:Real).
  617.  
  618.          When the Real on level one is a 0 the object in level two must be a
  619.          List, it is passed to a program that behaves like the built-in
  620.          command STOKEYS that is documented on the HP48 User's Manual. For
  621.          any other Real ASNK behaves just like the built-in command ASN.
  622.  
  623.       ASNK accepts an empty List instead of the Global Name 'SKEY' (to force
  624.       a key to have its standard definition) in order to save keystrokes.
  625.  
  626.  
  627.       +------+
  628.       | RCLK |            (ReCalL Keys)
  629.       +------+
  630.  
  631.       This is a Dual command:
  632.  
  633.       (1) When executed from the keyboard:
  634.  
  635.          Needs no arguments.
  636.  
  637.          Waits for a key to be pressed and recalls to level one the object
  638.          assigned to that key. If no object is assigned to that key, the HP48
  639.          will just beep. To abort the command execution you can press any key
  640.          two times quickly.
  641.  
  642.       (2) When executed by a running program (or from the command line):
  643.  
  644.          Needs one argument: (1:Real).
  645.  
  646.          Recalls to level two the object assigned to the key specified by the
  647.          Real in rc.p format and pushes the Real 1 on level one. If no object
  648.          is assigned to that key, only the Real 0 is pushed on level one.
  649.          If the argument is the Real 0 all the assignments of the current
  650.          User Keyboard are recalled as the built-in command RCLKEYS does.
  651.  
  652.          NOTE: When recalling all the assignments RCLK is three times faster
  653.                than RCLKEYS. This happens because RCLK uses a stack based
  654.                algorythm instead of the local_variables based algorythm used
  655.                by RCLKEYS (strangely the size of both programs is the same).
  656.  
  657.  
  658.                                   Page 8
  659.  
  660.  
  661.  
  662.  
  663.       +------+
  664.       | DELK |            (DELete Keys)
  665.       +------+
  666.  
  667.       This is a Dual command:
  668.  
  669.       (1) When executed from the keyboard:
  670.  
  671.          Needs no arguments.
  672.  
  673.          Waits for a key to be pressed and deletes the assignment of that
  674.          key. If no object is assigned to that key, the HP48 will just beep.
  675.          If an object is assigned to that key, the command LASTARG, if
  676.          active, will push to level one the old assignment. To abort the
  677.          command execution you can press any key two times quickly.
  678.  
  679.       (2) When executed by a running program (or from the command line):
  680.  
  681.          Needs one argument: (1:Real/List/Global_Name/Local_Name).
  682.  
  683.          Refer to documentation of the built-in command DELKEYS on the HP48
  684.          User's Manual.
  685.  
  686.  
  687.       +-------+
  688.       | DISPK |           (DISPlay Key assignments)
  689.       +-------+
  690.  
  691.       Needs no arguments.
  692.  
  693.       Waits for a key to be pressed and displays on the screen the position
  694.       of that key, the number and the name of the current keyboard and the
  695.       six objects assigned to that key. To abort the command execution you
  696.       can press any key two times quickly.
  697.  
  698.  
  699.       +------+
  700.       | STDK |            (recall STandarD Key definition)
  701.       +------+            (see example in paragraph 3.2)
  702.  
  703.       This is a Dual command:
  704.  
  705.       (1) When executed from the keyboard:
  706.  
  707.          Needs no arguments.
  708.  
  709.          Waits for a key to be pressed and recalls the standard assignment of
  710.          that key. To abort the command execution you can press any key two
  711.          times quickly.
  712.  
  713.       (2) When executed by a running program (or from the command line):
  714.  
  715.          Needs one argument: (1:Real).
  716.  
  717.          Since not all the standard key assignments can be recalled using
  718.          method (1), this second way is provided. The Real on level one must
  719.          be in the same format as required by the built-in command ASN
  720.          (rc.p). The standard assignment of the specified key is recalled to
  721.          level one.
  722.  
  723.  
  724.                                   Page 9
  725.  
  726.  
  727.  
  728.  
  729.       +------+
  730.       | RECK |            (RECord Keys)
  731.       +------+            (see example in paragraph 3.3)
  732.  
  733.       This is a Dual command:
  734.  
  735.       (1) When executed from the keyboard:
  736.  
  737.          Needs no arguments.
  738.  
  739.          Records a sequence of two or more standard keys. The only thing that
  740.          distinguishes this recording session from the normal state is the
  741.          message RECK displayed in the status area instead of USER. To finish
  742.          the recording session you need to press [alpha] [CONT] (key 91.5) or
  743.          cause an Error (the key that caused the error will not be recorded).
  744.          At this point a program will be pushed to level one (this will not
  745.          happen if you have recorded only one key. Use STDK for this), that
  746.          is the record: its evaluation will cause the reproduction of the key
  747.          sequence; it doesn't need to be processed by \->EVL. For a correct
  748.          evaluation, assign it to a key or store it in a Global variable.
  749.  
  750.          RECK will record every key except those pressed while running a
  751.          program, even the built-in programs, e.g. the EquationWriter, or the
  752.          standard editor. For example, while recording, you can edit
  753.          something but the keys pressed while you are in the editor (*not in
  754.          the command line*) will not be recorded, and the recording session
  755.          will restart when you exit from the editor.
  756.  
  757.       (2) When executed by a running program (or from the command line):
  758.  
  759.          Needs one argument: (1:List).
  760.  
  761.          The List must contain more than one Real number in rc.p format: the
  762.          corresponding key sequence will be created on level one as for (1).
  763.          The same limitations as for (1) apply.
  764.  
  765.  
  766.       +------+
  767.       | KEYN |            (KEY Number)
  768.       +------+            (see example in paragraph 3.3)
  769.  
  770.       Needs no arguments.
  771.  
  772.       Asks you to press a key and puts its number in rc format on level one;
  773.       then you have to press a key between [1] and [6] (any other key will
  774.       just beep) to complete the result with the key plane so that the Real
  775.       on level one will be in rc.p format. This particular method allows you
  776.       to get the rc.p key identifier of any key, including the shifted shift
  777.       keys. To abort the command execution you can press any key two times
  778.       quickly.
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.                                   Page 10
  791.  
  792.  
  793.  
  794.  
  795.       +------------+
  796.       | \->IFCMDTE |      (make "IF CoMmanD line Then Else" program)
  797.       +------------+      (see examples in paragraphs 3.2 and 3.4)
  798.  
  799.       Needs two arguments: (2:Any, 1:Any).
  800.  
  801.       Leaves on level one a program that, when evaluated, checks if there is
  802.       the Command Line:
  803.       - If yes, it evaluates the level two argument.
  804.       - If not, it evaluates the level one argument.
  805.       The resulting program doesn't need to be processed by \->EVL.
  806.  
  807.  
  808.       +------------+
  809.       | \->IFIMMTE |      (make "IF IMMediate-entry mode Then Else" program)
  810.       +------------+
  811.  
  812.       Needs two arguments: (2:Any, 1:Any).
  813.  
  814.       Leaves on level one a program that, when evaluated, checks if the HP48
  815.       is in Immediate-Entry Mode:
  816.       - If yes, it evaluates the level two argument.
  817.       - If not, it evaluates the level one argument.
  818.       The resulting program doesn't need to be processed by \->EVL.
  819.       For information on Entry-Modes see the HP48 manual at page 76 (page
  820.       3-16 in the newer, single-volume Owner's Manual).
  821.  
  822.  
  823.       +------------+
  824.       | \->IFPRGTE |      (make "IF PRoGram-entry mode Then Else" program)
  825.       +------------+      (see examples in paragraphs 3.1 and 3.4)
  826.  
  827.       Needs two arguments: (2:Any, 1:Any).
  828.  
  829.       Leaves on level one a program that, when evaluated, checks if the HP48
  830.       is in Program-Entry Mode:
  831.       - If yes, it evaluates the level two argument.
  832.       - If not, it evaluates the level one argument.
  833.       The resulting program doesn't need to be processed by \->EVL.
  834.       For information on Entry-Modes see the HP48 manual at page 76 (page
  835.       3-16 in the newer, single-volume Owner's Manual).
  836.  
  837.  
  838.       +------------+
  839.       | \->IFALGTE |      (make "IF ALGebraic-entry mode Then Else" program)
  840.       +------------+
  841.  
  842.       Needs two arguments: (2:Any, 1:Any).
  843.  
  844.       Leaves on level one a program that, when evaluated, checks if the HP48
  845.       is in Algebraic-Entry Mode:
  846.       - If yes, it evaluates the level two argument.
  847.       - If not, it evaluates the level one argument.
  848.       The resulting program doesn't need to be processed by \->EVL.
  849.       For information on Entry-Modes see the HP48 manual at page 76 (page
  850.       3-16 in the newer, single-volume Owner's Manual).
  851.  
  852.  
  853.  
  854.  
  855.  
  856.                                   Page 11
  857.  
  858.  
  859.  
  860.  
  861.       +-----------+
  862.       | \->IF1KTE |      (make "IF ONE Keystroke Then Else" program)
  863.       +-----------+      (see example in paragraph 3.8)
  864.  
  865.       Needs two arguments: (2:Any, 1:Any).
  866.  
  867.       Leaves on level one a program that, when evaluated, checks if there was
  868.       a "single click" of the key (as for a computer mouse):
  869.       - If yes, it evaluates the level two argument.
  870.       - If not (the "double click" case), it evaluates the level one
  871.         argument.
  872.       The resulting program doesn't need to be processed by \->EVL.
  873.  
  874.  
  875.       +--------+
  876.       | \->EVL |          (make "EVaLuate immediately" program)
  877.       +--------+          (see example in paragraph 3.4)
  878.  
  879.       Needs one argument: (1:Any).
  880.  
  881.       Leaves on level one a program that, when assigned to a key, or stored
  882.       in a menu, is evaluated immediately, even during command line entry
  883.       or while using the Matrix Writer (like the RAD key).
  884.  
  885.  
  886.       +--------+
  887.       | \->PSH |          (make "PuSH unevaluated immediately" program)
  888.       +--------+          (see example in paragraph 3.4)
  889.  
  890.       Needs one argument: (1:Any).
  891.  
  892.       Leaves on level one a program that when assigned to a key, or stored in
  893.       a menu, pushes the argument unevaluated to the first level of the
  894.       stack, even during command line entry or while using the Matrix Writer.
  895.  
  896.  
  897.       +---------+
  898.       | \->EDIT |         (make "EDIT only" program)
  899.       +---------+         (see example in paragraph 3.4)
  900.  
  901.       Needs one argument: (1:Any).
  902.  
  903.       Leaves on level one a program that when assigned to a key, or stored in
  904.       a menu, inserts the argument in the Command Line at the position of the
  905.       cursor. If there is no command line, it is created.
  906.  
  907.  
  908.       +--------+
  909.       | \->EQW |          (make "EQuationWriter-able" program)
  910.       +--------+
  911.  
  912.       Needs one argument: (1:Any).
  913.  
  914.       This is a powerful type of \->EVL: the object processed by this
  915.       command and assigned to a key can be executed also while the Equation
  916.       Writer is active; but remember, the stack *must* always be left intact
  917.       by the operation. The only part of the display allowed to be affected
  918.       by such an operation is the menu bar. If you don't obey to this rule
  919.       disastrous effects may occur.
  920.  
  921.  
  922.                                   Page 12
  923.  
  924.  
  925.  
  926.  
  927.       +-------+
  928.       | ADDFR |           (ADD a FReeze  program)
  929.       +-------+
  930.  
  931.       Needs two arguments: (2:Any, 1:Real).
  932.  
  933.       Every time a program execution finishes, the whole display is updated.
  934.       This action often wastes precious time. Many programs do not modify all
  935.       the display but only a part of it. (e.g. The command SWAP affects only
  936.       the stack area and not the status and the menu areas of the display;
  937.       the program \<< -64 SF \>> doesn't affect the display at all). The
  938.       ADDFR command adds to the object in level two an instruction that
  939.       freezes the display areas specified by the Real on level one. The Real
  940.       must be used as for the built-in command FREEZE.
  941.  
  942.  
  943.       +-------+
  944.       | 'BADK |           (push "BADKey" program onto stack)
  945.       +-------+
  946.  
  947.       Needs no argument.
  948.  
  949.       Pushes on the stack the sys-RPL instruction DoBadKey that is normally
  950.       associated with all disabled keys. When evaluated it just beeps and
  951.       freezes the screen.
  952.  
  953.  
  954.       +-------+
  955.       | \->KB |           (stack TO userKeyBoards)
  956.       +-------+
  957.  
  958.       This is a Safe command:
  959.  
  960.       Needs one argument: (1:List) / (1:Library Data)
  961.  
  962.       If the argument is a List:
  963.       It creates as many User Keyboards as specified by the dimension of the
  964.       List. The only limit to this dimension is the amount of available
  965.       memory. The memory occupied by an empty UserKeys List is about 60
  966.       bytes. The first object of the List is used to name the current User
  967.       Keyboard. The other objects are used to name the other User Keyboards.
  968.       If a name already exist, the corresponding User Keyboard is used
  969.       instead of a new one. This capability was implemented to help the user
  970.       to reorganize the User Keyboards, delete the unneeded ones, add new
  971.       ones, reorder and rename them.
  972.  
  973.       If the argument is a Library Data object:
  974.       the Library Data object must be the one created by KB\->. It replaces
  975.       all the User Keyboards with the ones archived in the Library Data
  976.       object.
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.                                   Page 13
  989.  
  990.  
  991.  
  992.  
  993.       +-------+
  994.       | KB\-> |           (userKeyBoards TO stack)
  995.       +-------+
  996.  
  997.       Needs no arguments.
  998.  
  999.       Recalls the UserKeyboards as a Library Data object and pushes the Real
  1000.       1 on the stack to say that the operation succeed. If there aren't
  1001.       UserKeyboards the result will be only a Real 0.
  1002.  
  1003.  
  1004.       +--------+
  1005.       | \->KBN |          (stack TO userKeyBoard Number/Name)
  1006.       +--------+
  1007.  
  1008.       Need one argument: (1:Real) / (1:String)
  1009.  
  1010.       Activates the specified User Keyboard. The same result can be obtained
  1011.       by pressing the corresponding named key in the User Keyboards Menu
  1012.       displayed by KBMN. If USER mode is not active, \->KBN activates it.
  1013.       For a faster execution you should consider to use a Real instead of a
  1014.       String.
  1015.  
  1016.  
  1017.       +--------+
  1018.       | KBN\-> |          (userKeyBoard Name&Number TO stack)
  1019.       +--------+
  1020.  
  1021.       Needs no arguments.
  1022.  
  1023.       Recalls the number of the active User Keyboard and tags it with its
  1024.       name. If there is only one User Keyboard, the result will be a zero
  1025.       tagged with the String "Undefined".
  1026.  
  1027.  
  1028.       +------+
  1029.       | KBNM |            (userKeyBoards NaMes)
  1030.       +------+
  1031.  
  1032.       Needs no arguments.
  1033.  
  1034.       Creates an ordered List containing all the names of the User Keyboards.
  1035.       If there aren't User Keyboards the result will be an empty List.
  1036.  
  1037.  
  1038.       +------+
  1039.       | KBMN |            (userKeyBoards MeNu)
  1040.       +------+
  1041.  
  1042.       Needs no arguments.
  1043.  
  1044.       Displays (if it exists) the User Keyboards Menu created by the command
  1045.       \->KB. This is a normal menu, similar to the MODES one. It allows you
  1046.       to switch easily and rapidly between all the User Keyboards you have
  1047.       created. If USER mode is not active, KBMN activates it. The menu
  1048.       displayed by KBMN has two different behaviours depending on the state
  1049.       of the user flag 50: if it's clear the menu behaves as a normal one, if
  1050.       it's set the menu is available only for one choice, after you have
  1051.       selected an User Keyboard the last menu is automatically redisplayed.
  1052.  
  1053.  
  1054.                                   Page 14
  1055.  
  1056.  
  1057.  
  1058.  
  1059.       +---------+
  1060.       | GETKEYS |         (GET userKEYS)
  1061.       +---------+
  1062.  
  1063.       Needs no arguments.
  1064.  
  1065.       Pushes to level two the current internal UserKeys List and to level one
  1066.       the Real 1 if unassigned keys are active or the Real 0 if unassigned
  1067.       keys aren't active. For information on the format of the internal
  1068.       UserKeys List refer to the appendix B of this manual.
  1069.  
  1070.  
  1071.       +---------+
  1072.       | PUTKEYS |         (PUT userKEYS)
  1073.       +---------+
  1074.  
  1075.       Needs two arguments: (2:List, 1:Real).
  1076.  
  1077.       Stores the List on level two as the current internal UserKeys List and
  1078.       the Real on level one as the state of unassigned keys: 0 stands for
  1079.       "disabled", any other number stands for "enabled". PUTKEYS does a
  1080.       complete argument checking on the List so to prevent a disaster.
  1081.       For information on the format of the internal UserKeys List refer to
  1082.       the appendix B of this manual.
  1083.  
  1084.       NOTE: If you implement PUTKEYS with a 0 on the first level, your
  1085.             keyboard may result locked up. To recover from this situation
  1086.             just press [ON]-[C] and, if the user flag 49 is set, press [ATTN]
  1087.             exactly when the screen reappears.
  1088.  
  1089.  
  1090.       +----------+
  1091.       | PACKKEYS |        (PACK userKEYS)
  1092.       +----------+
  1093.  
  1094.       Needs no arguments.
  1095.  
  1096.       Packs the User key assignments into their most compact form to save
  1097.       memory.
  1098.       As User key assignments are made or deleted (using the built-in
  1099.       commands ASN, STOKEYS, DELKEYS) a certain amount of memory is wasted.
  1100.       You can free this memory for other uses by packing the User key
  1101.       assignment with PACKKEYS (The SmartKeys commands don't need PACKKEYS to
  1102.       be used).
  1103.  
  1104.       NOTE: The command sequence described in the HP48 manual at page 220
  1105.             [page 15-10 in the newer, single-volume Owner's Manual], RCLKEYS
  1106.             0 DELKEYS STOKEYS, has a little bug/feature: if the unassigned
  1107.             keys are disabled (by 'S' DELKEYS), after its execution they will
  1108.             be all enabled. The command PACKKEYS, instead, do not change the
  1109.             unassigned keys state. It also packs the User key assignments
  1110.             into a more compact form almost immediately, unlike the Owner's
  1111.             Manual routine, which is very slow.
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.                                   Page 15
  1121.  
  1122.  
  1123.  
  1124.  
  1125.       +-------+
  1126.       | DOKEY |           (DO KEY object)
  1127.       +-------+           (see example in paragraph 3.5)
  1128.  
  1129.       Needs one argument: (1:Any).
  1130.  
  1131.       Note: DOKEY is only useful within programs; it is not useful from the
  1132.             keyboard.
  1133.  
  1134.       Evaluates level one object as it was assigned to a key.
  1135.  
  1136.  
  1137.       +------+
  1138.       | SAFE |            (disallow immediate execution of key assignment)
  1139.       +------+            (see example in paragraph 3.6)
  1140.  
  1141.       Needs two arguments: (2:Any, 1:String).
  1142.  
  1143.       Note: SAFE is only useful within programs; it is not useful from the
  1144.             keyboard.
  1145.  
  1146.       SAFE puts the name of the program on the command line if the program is
  1147.       executed directly; otherwise, the level two argument is executed. As
  1148.       for DUAL, the string on level one must contain the name of the program.
  1149.       The built-in CLVAR key (blue-DEL key) is an example of a Safe key.
  1150.  
  1151.  
  1152.       +------+
  1153.       | DUAL |            (branch depending on keyboard or program execution)
  1154.       +------+            (see example in paragraph 3.7)
  1155.  
  1156.       Needs three arguments: (3:Any, 2:Any, 1:String).
  1157.  
  1158.       Note: DUAL is only useful within programs; it is not useful from the
  1159.             keyboard.
  1160.  
  1161.       If the program containing the DUAL command is executed directly (that
  1162.       is, by pressing a menu key or a key to which the program or its name is
  1163.       assigned), DUAL evaluates the argument in level two. Otherwise, if the
  1164.       program isn't executed directly (that is, by being called from within
  1165.       another program), the level three argument will be evaluated. The
  1166.       string on level one must contain the name (Global or XLIB) under which
  1167.       the program is stored.
  1168.  
  1169.  
  1170.       +---------+
  1171.       | \->CSTM |         (creates the CSTM and CST variables)
  1172.       +---------+
  1173.  
  1174.       This is a Safe command:
  1175.  
  1176.       Needs one argument: (1:List).
  1177.  
  1178.       Stores the List in a Global variable named CSTM in the current
  1179.       directory and overwrites the content of the Global variable CST in the
  1180.       home directory with a special custom-menu List. From now on to edit or
  1181.       modify your custom menus you must refer to the Global variables named
  1182.       CSTM and no more to those named CST. Anyway the custom menu is always
  1183.       accessed by the [CST] key.
  1184.  
  1185.  
  1186.                                   Page 16
  1187.  
  1188.  
  1189.  
  1190.  
  1191.       +---------+
  1192.       | \->MENU |         (display temporary advanced MENU)
  1193.       +---------+         (see example in paragraph 3.9)
  1194.  
  1195.       Needs one argument: (1:List).
  1196.  
  1197.       It displays the List as a temporary menu with all the capabilities of
  1198.       the Advanced Menu System. Unlike the built-in command TMENU, the menu
  1199.       is displayed also while a program is running.
  1200.  
  1201.  
  1202.       +-------+
  1203.       | HTRIM |           (Homedir-TRIM)
  1204.       +-------+
  1205.  
  1206.       Need one argument: (1:List) / (1:Real)
  1207.  
  1208.       It works only in the HOME directory.
  1209.       If the argument is a List HTRIM orders the variables specified in the
  1210.       List as the built-in command ORDER does (the smaller is the List, the
  1211.       smaller is the time required), the only difference is that all the
  1212.       remaining variables becames hidden: you can still use them as usual but
  1213.       they won't appear on the VAR menu and in the List created by the VARS
  1214.       command. To hide all the variables use an empty List. If the argument
  1215.       is the Real 0, HTRIM bring back to light all the hidden variables. This
  1216.       command is very useful to keep clean and tidy the VAR menu of the HOME
  1217.       directory.
  1218.  
  1219.       NOTE: HTRIM makes a complete error check and has worked well under
  1220.             every test I made but, as it deals with a very delicate part of
  1221.             the HP48 Operating System, in some particular case it can cause
  1222.             problems, expecially if you're not using well-written software.
  1223.  
  1224.  
  1225.       +---------+
  1226.       | ABOUTSK |         (ABOUT SmartKeys)
  1227.       +---------+
  1228.  
  1229.       Needs no arguments.
  1230.  
  1231.       This is a Dual command:
  1232.  
  1233.       (1) When executed from the keyboard:
  1234.  
  1235.          Shows the Library version and a copyright message.
  1236.  
  1237.       (2) When executed by a running program (or from the command line):
  1238.  
  1239.          Puts on level one the version String of the Library (so SmartKeys-
  1240.          based programs can prevent errors).
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.                                   Page 17
  1253.  
  1254.  
  1255.  
  1256.  
  1257.       +---------+
  1258.       | $CONFIG |         (hidden)
  1259.       +---------+
  1260.  
  1261.       Needs no argument.
  1262.  
  1263.       It's automatically executed after every warm-start (e.g. [ON]-[C]).
  1264.       It checks if the user flag 49 is set; if yes, it sets the system flags
  1265.       -61 ([USR] once to lock) and -62 (User Mode active). So if you wish to
  1266.       stay in USER mode permanently, set flag 49 and the User Keyboard will
  1267.       be always active.
  1268.  
  1269.       This hidden command gives you also the possibility to reconfigure your
  1270.       calculator after a warm-start: if you store a program in a Global
  1271.       variable named CONFIG and contained in the Home directory then it will
  1272.       be automatically executed just after the warm-start.
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.                                   Page 18
  1319.  
  1320.  
  1321.  
  1322.  
  1323. 3.  Commands Usage Examples
  1324. ---------------------------
  1325.  
  1326.  
  1327. 3.1   Commands used: \->IFPRGTE ASNK
  1328.  
  1329.       When not in Program-Entry Mode the command SWAP is usually executed by
  1330.       pressing [ > ]  (key 36.1) so the combination [orange shift]   [ > ]
  1331.       serves no purpose.
  1332.       Now you can assign to [orange shift]  [ > ] a program that, when in
  1333.       Program-Entry Mode, will insert SWAP in the command line as usual but
  1334.       when in Immediate-Entry Mode will implement an OVER.
  1335.  
  1336.         _________________________            _________________________
  1337.         |{HOME}                 |            |{HOME}                 |
  1338.         |-----------------------|            |-----------------------|
  1339.         |4:                     |            |4:                     |
  1340.         |3:                     |            |3:                     |
  1341.         |2:                 SWAP|            |2:                     |
  1342.         |1:                 OVER|            |1:                     |
  1343.         |### ### ### ### ### ###|            |### ### ### ### ### ###|
  1344.         `-----------------------'            `-----------------------'
  1345.       1) Enter the List { SWAP             2) Press \->IFPRGTE to obtain
  1346.          OVER } and press OBJ\->              the new assignment.
  1347.          followed by DROP to obtain           Press ASNK and then the
  1348.          the two command unevaluated.         [orange shift]  [ > ] key
  1349.                                               to assign it to that key.
  1350.  
  1351.  
  1352.  
  1353. 3.2   Commands used: STDK \->IFCMDTE ASNK
  1354.  
  1355.       The [DEL] key serves no purpose when there isn't a command line.
  1356.       Now you can assign to it a program that when the command line is not
  1357.       present will execute LASTARG, otherwise it will behave like the normal
  1358.       [DEL] key.
  1359.  
  1360.         _________________________            _________________________
  1361.         |{HOME}                 |            |{HOME}                 |
  1362.         |-----------------------|            |-----------------------|
  1363.         |4:                     |            |4:                     |
  1364.         |3:                     |            |3:                     |
  1365.         |2: External External ..|            |2:                     |
  1366.         |1:              LASTARG|            |1:                     |
  1367.         |### ### ### ### ### ###|            |### ### ### ### ### ###|
  1368.         `-----------------------'            `-----------------------'
  1369.       1) Implement STDK and press          2) Press \->IFCMDTE to obtain
  1370.          [DEL] to recall the key              the new [DEL] key assignment.
  1371.          routine. Enter the List              Press ASNK and then the [DEL]
  1372.          { LASTARG } and press                key to assign the program in
  1373.          OBJ\-> DROP to obtain the            level one to it.
  1374.          LASTARG command.
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.                                   Page 19
  1385.  
  1386.  
  1387.  
  1388.  
  1389. 3.3   Commands used: KEYN RECK ASNK
  1390.  
  1391.       Usually in order to enter a String you need to use the alpha keyboard
  1392.       so every time it takes four (or three) keystrokes:
  1393.  
  1394.       [blue-shift]   [ - ]   [alpha]  ( [alpha] )
  1395.  
  1396.       Now you can assign to the key [blue-shift] [ - ] a program that
  1397.       automatically enters the alpha keyboard.
  1398.  
  1399.         _________________________            _________________________
  1400.         |{HOME}                 |            |{HOME}                 |
  1401.         |-----------------------|            |-----------------------|
  1402.         |4:                     |            |4:                     |
  1403.         |3:                     |            |3:                     |
  1404.         |2:                     |            |2:                     |
  1405.         |1:        { 85.3 61.4 }|            |1:                     |
  1406.         |### ### ### ### ### ###|            |### ### ### ### ### ###|
  1407.         `-----------------------'            `-----------------------'
  1408.       1) Enter an empty List, then         2) Press [ENTRY], [RECK] and
  1409.          press KEYN and then [ - ]            [ENTER] to convert the List
  1410.          and [ 3 ] so to obtain the           on level one to the
  1411.          Real number 85.3, press              corresponding keys sequence.
  1412.          [ + ]. Then press KEYN,              Finally press ASNK and press
  1413.          [alpha], [ 4 ] so to obtain the      the [blue-shift] [ - ] key so
  1414.          Real number 61.4, press [ + ].       that the program in level one
  1415.          (If you keep flag -60 set,           is assigned to that key.
  1416.          use 61.1, not 61.4).
  1417.  
  1418.  
  1419.  
  1420. 3.4   Commands used: \->PSH \->EVL \->IFPRGTE \->EDIT \->IFCMDTE
  1421.  
  1422.       Now it's time to build yourself the silliest key assignment ever seen:
  1423.  
  1424.       It checks if there is the command line and:
  1425.        - if not, it will start the command line with the String "STARTcmd".
  1426.        - if yes, it checks if Program-Entry Mode is active and:
  1427.                - if yes, it will push to the first level the String "PRGon".
  1428.                - if not, it will evaluate the program \<< "PRG" "off" + \>>.
  1429.  
  1430.         _________________________            _________________________
  1431.         |{HOME}                 |            |{HOME}                 |
  1432.         |-----------------------|            |-----------------------|
  1433.         |4:                     |            |4:                     |
  1434.         |3:                     |            |3:                     |
  1435.         |2:                     |            |2:              "PRGon"|
  1436.         |1:              "PRGon"|            |1:\<< "PRG" "off" + \>>|
  1437.         |### ### ### ### ### ###|            |### ### ### ### ### ###|
  1438.         `-----------------------'            `-----------------------'
  1439.       1) Enter the String "PRGon"          2) Enter the program \<< "PRG"
  1440.          and press \->PSH to make             "off" + \>> and press \->EVL
  1441.          it pushable.                         to make it evaluable.
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.                                   Page 20
  1451.  
  1452.  
  1453.  
  1454.  
  1455.         _________________________            _________________________
  1456.         |{HOME}                 |            |{HOME}                 |
  1457.         |-----------------------|            |-----------------------|
  1458.         |4:                     |            |4:                     |
  1459.         |3:                     |            |3:                     |
  1460.         |2:                     |            |2: External External ..|
  1461.         |1: External External ..|            |1: "STARTcmd" Externa..|
  1462.         |### ### ### ### ### ###|            |### ### ### ### ### ###|
  1463.         `-----------------------'            `-----------------------'
  1464.       3) Press \->IFPRGTE.                 4) Enter the String "STARTcmd"
  1465.                                               and press \->EDIT to make
  1466.                                               it editable.
  1467.  
  1468.         _________________________            _________________________
  1469.         |{HOME}                 |            |{HOME}                 |
  1470.         |-----------------------|            |-----------------------|
  1471.         |4:                     |            |4:                     |
  1472.         |3:                     |            |3:                     |
  1473.         |2:                     |            |2:                     |
  1474.         |1: External External ..|            |1:                     |
  1475.         |### ### ### ### ### ###|            |SILLY #################|
  1476.         `-----------------------'            `-----------------------'
  1477.       5) Press \->IFCMDTE to               6) I don't think you want to
  1478.          obtain your brand new                waste a key for such a
  1479.          smart key.                           stupid assignment so:
  1480.                                               Enter the String "SILLY",
  1481.                                               implement SWAP 2 \->LIST 1
  1482.                                               \->LIST to store the program
  1483.                                               and the String in a menu
  1484.                                               an finally press TMENU.
  1485.  
  1486.  
  1487.  
  1488. 3.5   Command used: DOKEY
  1489.  
  1490.       To force a Dual or Safe command to behave as it was assigned to a key
  1491.       you just need to put the command on the stack and execute DOKEY on it.
  1492.       For example, the following program will display the SmartKeys screen:
  1493.  
  1494.       %%HP: T(3);
  1495.       \<< { ABOUTSK } 1 GET DOKEY \>>
  1496.  
  1497.  
  1498.  
  1499. 3.6   Command used: SAFE
  1500.  
  1501.       The following is a Safe program that purges the graphic display:
  1502.  
  1503.       %%HP: T(3);
  1504.       \<<
  1505.       \<< PICT PURGE \>>   @  The 'dangerous' code.
  1506.       "PPICT"              @  The name used to store the entire program.
  1507.       SAFE
  1508.       \>>
  1509.  
  1510.       Download (or type in) this program and store it with the name 'PPICT'.
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.                                   Page 21
  1517.  
  1518.  
  1519.  
  1520.  
  1521. 3.7   Command used: DUAL
  1522.  
  1523.       The following is a Dual program that puts "From Keyboard" on level 1
  1524.       if executed from the keyboard, or "From Program" if executed from a
  1525.       program:
  1526.  
  1527.       %%HP: T(3);
  1528.       \<<
  1529.       "From Program"     @ the code to execute if called by a program
  1530.       "From Keyboard"    @ the code to execute if called from keyboard
  1531.       "EX3P7"            @ the name used to store this entire program
  1532.       DUAL
  1533.       \>>
  1534.  
  1535.       Download (or type in) this program and store it with the name 'EX3P7'.
  1536.       If you press the 'EX3P7' menu key, you'll see "From Keyboard".  But
  1537.       \<< EX3P7 \>> [ENTER], then EVAL will produce "From Program".
  1538.  
  1539.  
  1540.  
  1541. 3.8   Command used: \->IF1KTE
  1542.  
  1543.       The command \->IF1KTE is used internally in the commands ASNK, RCLK,
  1544.       DELK, DISPK, STDK, KEYN. When they are waiting for a key to be pressed,
  1545.       if you press a key once, the command is executed normally, if you press
  1546.       it twice quickly the command is aborted.
  1547.  
  1548.  
  1549.  
  1550. 3.9   Command used: \->MENU
  1551.  
  1552.       The following List contains an Advanced Menu, put it on the stack and
  1553.       execute \->MENU.
  1554.  
  1555.       %%HP: T(3);
  1556.       {  'CST'      @ Dir-like menu label: Display the custom menu
  1557.          "&1616"    @ Dir-like menu label: Display the SmartKeys menu
  1558.          "&IOPAR"   @ Full menu label, contains the IOPAR list
  1559.          DISPK      @ Standard menu label: TakeOver XLIB (always evaluated)
  1560.       }
  1561.  
  1562.  
  1563.  
  1564.       As you can see, the examples are finished, now it's up to you...
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.                                   Page 22
  1583.  
  1584.  
  1585.  
  1586.  
  1587.       Appendixes
  1588.       ----------
  1589.  
  1590.  
  1591. A     Unused and Useless HP48 Default Key Assignments
  1592.  
  1593.       In order to take full advantage of the SmartKeys Library you may want
  1594.       to know what the gaps in the HP48 default key assignments are, so you
  1595.       can fill them with your own key definitions. If so, the following table
  1596.       will help you.
  1597.  
  1598.  
  1599.           +-----------------------------------------------------+
  1600.           |   UNUSED AND USELESS HP48 DEFAULT KEY ASSIGNMENTS   |
  1601.           +-----------++---------------------++-----------------+
  1602.           | ENTRY     ||        UNUSED       ||   ? USELESS ?   |
  1603.           | MODE      ||------+--------------++---------+-------+
  1604.           |           || NUMB |  SPECIFICAT. || NUMBER  | SPECS |
  1605.           +-----------++------+--------------++---------+-------+
  1606.           | IMMEDIATE || 25.3 | BlShft-up    || 34.1or2 | GRAPH |
  1607.           | ENTRY     || 34.3 | BlShft-left  || 36.1or2 | SWAP  |
  1608.           | MODE      || 36.3 | BlShft-right || 55.1or2 | DROP  |
  1609.           | &  NO     || 51.4 | alpha-ENTER  || 91.2or5 | CONT  |
  1610.           | COMMAND   || 54.1 | DEL          || 91.3or6 | OFF   |
  1611.           | LINE      || 54.4 | alpha-DEL    || 92.3    | \->   |
  1612.           |           || 55.4 | alpha-BckSpc || 93.2    | ,     |
  1613.           |           || 62.5 | ` accent     || 93.3    |  <-'  |
  1614.           |           || 62.6 | ' accent     || 94.1    | SPC   |
  1615.           |           || 63.5 | ^ accent     || 94.3    | \<)   |
  1616.           |           || 63.6 | ~ accent     ||         |       |
  1617.           |           || 64.5 | " accent     ||         |       |
  1618.           |           || 64.6 | etc. accent  ||         |       |
  1619.           +-----------++------+--------------++---------+-------+
  1620.           | IMMEDIATE ||      |              || 34.2    | GRAPH |
  1621.           | ENTRY     ||      |              || 36.2    | SWAP  |
  1622.           | MODE      ||      |              || 55.2    | DROP  |
  1623.           |   &       ||      |              || 91.2or5 | CONT  |
  1624.           | COMMAND   ||      |              || 91.3or6 | OFF   |
  1625.           | LINE      ||      |              || 92.3    | \->   |
  1626.           |===========||======|==============||=========|=======|
  1627.           | PROGRAM   || 52.3 | VISIT        || 51.2or3 | DUP   |
  1628.           | ENTRY     || 53.2 | 2D           || 91.2or5 | CONT  |
  1629.           | MODE      || 53.3 | 3D           || 91.3or6 | OFF   |
  1630.           |           || 62.3 | solver       ||         |       |
  1631.           |           || 64.3 | eq catalog   ||         |       |
  1632.           |           || 72.3 | alrm catalog ||         |       |
  1633.           +-----------++------+--------------++---------+-------+
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.                                   Page 23
  1649.  
  1650.  
  1651.  
  1652.  
  1653. B     The Internal UserKeys List
  1654.  
  1655.       When no keys are assigned to the User Keyboard, the internal UserKeys
  1656.       List is empty. When one or more assignments have been made, the
  1657.       internal UserKeys List contains forty nine Lists, each of which can be
  1658.       an empty List (if the key has no assignments) or a six element List (if
  1659.       the key has one or more assignments). Each of these six elements is the
  1660.       object assigned to the key in keyplane order, or an empty List if that
  1661.       keyplane has no assignment.
  1662.  
  1663.       Example: Assuming that no keys are assigned, when you assign the
  1664.                command % to the key DEF your internal UserKeys List will look
  1665.                like this:
  1666.  
  1667.                { {} {} {} {} {} {}
  1668.                  {} {} {} {} {} {}
  1669.                  {} {{}%{}{}{}{}} {} {} {} {}
  1670.                  {} {} {} {} {} {}
  1671.                  {} {} {} {} {}
  1672.                  {} {} {} {} {}
  1673.                  {} {} {} {} {}
  1674.                  {} {} {} {} {}
  1675.                  {} {} {} {} {} }
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.                                   Page 24
  1715.  
  1716.  
  1717.  
  1718.  
  1719. C     Quick Reference Guide
  1720.  
  1721.       - Contents
  1722.  
  1723.         Informations
  1724.         Reserved user-flags
  1725.         Reserved Global variables
  1726.         Command Reference
  1727.  
  1728.  
  1729.       - Informations:
  1730.  
  1731.         Name:     SmartKeys
  1732.         Version:  1.59
  1733.         Type:     Library
  1734.         Size:     5675
  1735.         Checksum: # 6DE4h
  1736.         Author:   Simone A. Rapisarda - via L. Gereschi, 6  56127 PISA  ITALY
  1737.  
  1738.  
  1739.       - Reserved user-flags:
  1740.  
  1741.         49 (if set: User Mode always active)
  1742.         50 (if set: Only-one-choice UserKeyboards_Menu)
  1743.  
  1744.  
  1745.       - Reserved Global variables:
  1746.  
  1747.         CST (only in the HOME directory)
  1748.         CSTM
  1749.         CONFIG (only in the HOME directory)
  1750.  
  1751.  
  1752.       - Command Reference:
  1753.  
  1754.         ASNK        - ASsigN Keys
  1755.                       Dual(keyboard)-Interactive: ( Any -> )
  1756.                                                   ( List[empty] -> )
  1757.                       Dual(program): ( Any Real[rc.p] -> )
  1758.                                      ( List[empty] Real[rc.p] -> )
  1759.                                      ( List Real[0] -> )
  1760.  
  1761.         RCLK        - ReCalL Keys
  1762.                       Dual(keyboard)-Interactive: ( -> Any )
  1763.                                                   ( -> )
  1764.                       Dual(program): ( Real[rc.p] -> Any 1 )
  1765.                                      ( Real[rc.p] -> 0 )
  1766.                                      ( Real[0] -> List )
  1767.  
  1768.         DELK        - DELete Keys
  1769.                       Dual(keyboard)-Interactive: ( -> )
  1770.                       Dual(program): ( Real[rc.p] -> )
  1771.                                      ( Real[0] -> )
  1772.                                      ( List_of_Reals[rc.p] -> )
  1773.                                      ( Global_Name/Local_Name['S'] -> )
  1774.  
  1775.         DISPK       - DISPlay Key assignments
  1776.                       Interactive: ( -> )
  1777.  
  1778.  
  1779.  
  1780.                                   Page 25
  1781.  
  1782.  
  1783.  
  1784.  
  1785.         STDK        - recall STandarD Key definition
  1786.                       Dual(keyboard)-Interactive: ( -> Any )
  1787.                       Dual(program): ( Real[rc.p] -> Any )
  1788.  
  1789.         RECK        - RECord Keys
  1790.                       Dual(keyboard)-Interactive: ( -> Program )
  1791.                                                   ( -> )
  1792.                       Dual(program): ( List_of_Reals[rc.p] -> Program )
  1793.  
  1794.         KEYN        - KEY Number
  1795.                       Interactive: ( -> Real[rc.p] )
  1796.  
  1797.         ->IFCMDTE   - make "IF CoMmanD line Then Else" program
  1798.                       ( Any Any -> Program )
  1799.  
  1800.         ->IFIMMTE   - make "IF IMMediate-entry mode Then Else" program
  1801.                       ( Any Any -> Program )
  1802.  
  1803.         ->IFPRGTE   - make "IF PRoGram-entry mode Then Else" program
  1804.                       ( Any Any -> Program )
  1805.  
  1806.         ->IFALGTE   - make "IF ALGebraic-entry mode Then Else" program
  1807.                       ( Any Any -> Program )
  1808.  
  1809.         ->IF1KTE    - make "IF ONE Keystroke Then Else" program
  1810.                       ( Any Any -> Program )
  1811.  
  1812.         ->EVL       - make "EVaLuate immediately" program
  1813.                       ( Any -> Program )
  1814.  
  1815.         ->PSH       - make "PuSH unevaluated immediately" program
  1816.                       ( Any -> Program )
  1817.  
  1818.         ->EDIT      - make "EDIT only" program
  1819.                       ( Any -> Program )
  1820.  
  1821.         ->EQW       - make "EQuationWriter-able" program
  1822.                       ( Any -> Program )
  1823.  
  1824.         ADDFR       - ADD a FReeze command
  1825.                       ( Any Real[1...7] -> Program )
  1826.  
  1827.         'BADK       - push "BADKey" program onto stack
  1828.                       ( -> Program )
  1829.  
  1830.         ->KB        - stack TO userKeyBoards
  1831.                       Safe: ( List_of_Names -> )
  1832.                             ( Library_Data -> )
  1833.  
  1834.         KB->        - userKeyBoards TO stack
  1835.                       ( -> Library_Data Real[1] )
  1836.                       ( -> Real[0] )
  1837.  
  1838.         \->KBN      - stack TO userKeyBoard Number/Name
  1839.                       ( Real/String -> )
  1840.  
  1841.         KBN\->      - userKeyBoard Name&Number TO stack
  1842.                       ( -> Tagged[Name:Real] )
  1843.  
  1844.  
  1845.  
  1846.                                   Page 26
  1847.  
  1848.  
  1849.  
  1850.  
  1851.         KBNM        - userKeyBoards NaMes
  1852.                       ( -> List_of_Strings )
  1853.  
  1854.         KBMN        - userKeyBoards MeNu
  1855.                       ( -> )
  1856.  
  1857.         GETKEYS     - GET userKEYS
  1858.                       ( -> List Real[0/1] )
  1859.  
  1860.         PUTKEYS     - PUT userKEYS
  1861.                       ( List Real[0/1] -> )
  1862.  
  1863.         PACKKEYS    - PACK userKEYS
  1864.                       ( -> )
  1865.  
  1866.         DOKEY       - DO KEY-object
  1867.                       ( Any -> ... )
  1868.  
  1869.         SAFE        - disallow immediate execution of key assignment
  1870.                       ( Any String -> ... )
  1871.  
  1872.         DUAL        - branch depending on keyboard or program execution
  1873.                       ( Any Any String -> ... )
  1874.  
  1875.         \->CSTM     - creates the CSTM and CST variables
  1876.                       Safe: ( List[Menu] -> )
  1877.  
  1878.         \->MENU     - display temporary advanced MENU
  1879.                       ( List[Menu] -> )
  1880.  
  1881.         HTRIM       - Homedir-TRIM
  1882.                       ( List_of_Global_Names -> )
  1883.                       ( Real[0] -> )
  1884.  
  1885.         ABOUTSK     - ABOUT SmartKeys
  1886.                       Dual(keyboard): ( -> )
  1887.                       Dual(program): ( -> String[version#] )
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.                                   Page 27
  1913.  
  1914.